#ifndef NULL_LOG_BUF_H
#define NULL_LOG_BUF_H

#include <iostream>
namespace vpm
{
	namespace log 
	{
		namespace detail
		{
			class NullLogBuf : public std::streambuf 
			{
			public:
				NullLogBuf()
				{
					setp(buffer,buffer+Size);
				}

				virtual ~NullLogBuf()
				{
				}

				int sync ()
				{
					*(pptr()) = 0;
					setp(buffer, buffer+Size);
					return 0; 
				}

				int overflow(int c)
				{
					sync();
					if (c != EOF) 
					{
						*pptr() = static_cast<unsigned char>(c);
						pbump(1);
					}
					return 0;
				}

				// Defining xsputn is an optional optimization.
				// (streamsize was recently added to ANSI C++, not portable yet.)
				std::streamsize xsputn(const char *_Ptr, std::streamsize _Count)
				{
					return _Count;
				}

			private:
				enum { Size=4095 }; 
				char buffer[Size+1];
			};
		}
	}
}


#endif // 
  
 
